package com.xzx.server.controller;

import com.xzx.server.pojo.RespBean;
import com.xzx.server.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * 测试Swagger
 *
 * @author xzx on 2022/4/23
 */
@RestController
public class HelloController {

    @Autowired
    private IMenuService menuService;
    @GetMapping("hello")
    public  String hello(){
        return "hello";
    }

    @GetMapping("/employee/basic/hello")
    public String hello2() {
        return "/employee/basic/hello";
    }

    @GetMapping("/employee/advanced/hello")
    public String hello3() {
        return "/employee/advanced/hello";
    }

    @GetMapping("/menus")
    public RespBean test() {
        //根据角色获得
        return RespBean.success("测试成功",menuService.getMenusWithRole());
    }

}
